/**
 * Created by PC on 2018/12/11.
 */
$().ready(function () {
// 在键盘按下并释放及提交后验证提交表单
    // 登录和产品添加
    $("#my_form").validate({
        rules: {
            name: {
                required: true,
                minlength: 2,
                maxlength: 16
            },
            account: {
                required: true,
                minlength: 3,
                maxlength: 16
            },
            password: {
                required: true,
                minlength: 8,
                maxlength: 16
            },
            password_again: {
                required: true,
                minlength: 8,
                maxlength: 16,
                equalTo: "#password"
            }

        },
        messages: {
            name: {
                required: "请输入渠道名",
                minlength:"渠道名不少于2个字符",
                maxlength: "渠道名最长不超过16个字符"
            },
            account: {
                required: "请输入渠道登录账号",
                minlength: "账号最少为3个字符",
                maxlength: "账号最长为16个字符"
            },
            password: {
                required: "请输入渠道登录密码",
                minlength: "密码最少为8个字符",
                maxlength: "密码最长为16个字符"
            },
            password_again: {
                required: "请输入渠道登录密码",
                minlength: "密码最少为8个字符",
                maxlength: "密码最长为16个字符",
                equalTo: "两次密码不一致"
            }
        }
    })
});